<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>固定定位</title>

    <script src="../../js/jquery-latest.js"></script>
</head>
<body>

<h1>固定定位</h1>

<!--<div class="container">
    <div class="float left">
        左浮动
    </div>
    <div class="float left clear">
        左浮动
        clear
    </div>
</div>-->

<div class="container">
    <div class="float left relative1">
        相对浮动1
    </div>
    <div class="float left relative2">
        相对浮动2
    </div>
</div>


<style type="text/css">
    *.container{
        height: 1000px;
        background-color: #129953;
    }

    *.box{
        position: fixed;
        height : auto;
        width : 100px;
        top: 300px;
        background-color: #8FA03D;
    }

    .float{
        border: 2px solid royalblue;
        background-color: rosybrown;
    }

    .left{
        float: left;
    }
    .clear{
        clear: left;
    }

    .relative1{
        position: relative;
        z-index: 1;
    }
    .relative2{
        position: relative;
        z-index: 2;
        top: 5px;
        left: -50px;
    }
</style>


</body>
</html>